#
# lcdhost.pro
#
# Johan Lindh <johan@linkdata.se> is the maintainer of this file.
# Do not alter to this file unless you have explicit approval.
#
# If you find a bug or need a feature or change, submit an issue at
# http://code.google.com/p/lcdhost/issues/list
#
# You should store your build preferences in "lcdhost.prf".
# You'll need to set a couple of build variables in it:
#
# LH_DESTDIR is used by linkdata/linkdata.prf to set a default
#   DESTDIR for applications, dynamic and static libraries.
#
# LH_LCDHOST_LIST is a list which subdirectories in the repository
#   root to build. Recommended setting is "linkdata plugins"
#
# LH_PLUGINS_LIST is used by plugins/plugins.pro. It's a list
#   of subdirectories in plugins/ to build.
#
# This file will create a default "lcdhost.prf" for you
# if it is missing when qmake runs.
#
# You should consider signing your plugins. Please read
# "linkdata/SignPlugin.pri" for details on how to do so.
#

defineTest(lcdhost_prf) {
        win32: system(echo $$quote($$1)>>$$LCDHOST_PRF)
        else: system(echo \'$$quote($$1)\'>>$$LCDHOST_PRF)
}

LCDHOST_PRF=$$[LCDHOST_PRF]
isEmpty(LCDHOST_PRF) {
    LCDHOST_PRF="$$PWD/lcdhost.prf"
    !exists($$LCDHOST_PRF) {
        warning("creating default $$LCDHOST_PRF")
        lcdhost_prf("$$LITERAL_HASH Generated by lcdhost.pro")
        lcdhost_prf("LH_LCDHOST_LIST = linkdata plugins")
        lcdhost_prf("LH_PLUGINS_LIST = $$LITERAL_HASH Leave empty to build all plugins")
        lcdhost_prf("CONFIG(debug):LH_DESTDIR=\"$$PWD/debug\"")
        lcdhost_prf("else:LH_DESTDIR=\"$$PWD/release\"")
        lcdhost_prf("load(\"$$PWD/linkdata/linkdata.prf\")")
        lcdhost_prf("exists(\"$$PWD/../private.pem\") { $$LITERAL_HASH You should keep it outside the repo")
        lcdhost_prf("    SIGNATURE_PRIVATE_FILE=\"$$PWD/../private.pem\"")
        lcdhost_prf("    SIGNATURE_PUBLIC_URL=http://my.website/myplugin/public.pem")
        lcdhost_prf("    include(\"$$PWD/linkdata/SignPlugin.pri\")")
        lcdhost_prf("}")
    }
    system( qmake -set LCDHOST_PRF $$LCDHOST_PRF )
}
!exists($$[LCDHOST_PRF]): error( "can't find LCDHost build preferences file" $$[LCDHOST_PRF] )

TARGET = $$basename(PWD)
TEMPLATE = subdirs
CONFIG += ordered

load($$[LCDHOST_PRF])
isEmpty(LH_LCDHOST_LIST): LH_LCDHOST_LIST = linkdata plugins
SUBDIRS = $$LH_LCDHOST_LIST
